#include <iostream>
using namespace std;

class A {
public:
	A (void) {
		cout << "A::A(void)" << endl;
	}
	~A (void) {
		cout << "A::~A(void)" << endl;
	}
	static void* operator new (size_t size) {
		cout << "A::A(new)" << endl;
		void *pv = malloc (size);
		return pv;
	}
	static void operator delete (void *pv) {
		cout << "A::delete()" << endl;
		free (pv);
	}
};

int main (void)
{
	//A *pa = A* A::operator new(sizeof(A))
	A* pa = new A;
	delete pa;
	return 0;
}
